package com.endoc.designpattern.command;

/**
 * 命令模式
 * listView-->command--->handler,实现listView依附command接口
 * 接收command
 */
public class ListView {
    Command command;
    public void setCommand(Command command){
        this.command =command;
    }
    public void executeCommand(){
        if(command!=null){
            command.execute();
        }
    }
}
